From: Ian Jackson Date: Fri, 31 Jan 2014 15:04:37 +0000 (+0000) Subject: libxl: timeouts: Break out time_occurs X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~5601 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=54f3f3850a8a34823d30591d13e658bbaa50232b;p=xen.git libxl: timeouts: Break out time_occurs Bring together the two places where etime->func() is called into a new function time_occurs. For one call site this is pure code motion. For the other the only semantic change is the introduction of a new debugging message. Signed-off-by: Ian Jackson Cc: Jim Fehlig Cc: Ian Campbell Acked-by: Ian Campbell --- diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c index 93f8fdc0cf..5a99932d96 100644 --- a/tools/libxl/libxl_event.c +++ b/tools/libxl/libxl_event.c @@ -381,6 +381,15 @@ void libxl__ev_time_deregister(libxl__gc *gc, libxl__ev_time *ev) return; } +static void time_occurs(libxl__egc *egc, libxl__ev_time *etime) +{ + DBG("ev_time=%p occurs abs=%lu.%06lu", + etime, (unsigned long)etime->abs.tv_sec, + (unsigned long)etime->abs.tv_usec); + + etime->func(egc, etime, &etime->abs); +} + /* * xenstore watches @@ -1007,11 +1016,7 @@ static void afterpoll_internal(libxl__egc *egc, libxl__poller *poller, time_deregister(gc, etime); - DBG("ev_time=%p occurs abs=%lu.%06lu", - etime, (unsigned long)etime->abs.tv_sec, - (unsigned long)etime->abs.tv_usec); - - etime->func(egc, etime, &etime->abs); + time_occurs(egc, etime); } } @@ -1092,7 +1097,8 @@ void libxl_osevent_occurred_timeout(libxl_ctx *ctx, void *for_libxl) assert(!ev->infinite); LIBXL_TAILQ_REMOVE(&CTX->etimes, ev, entry); - ev->func(egc, ev, &ev->abs); + + time_occurs(egc, ev); out: CTX_UNLOCK;